Lemon Squeezy

REST API v1 (no official Python SDK) · deprecated · verified Sun Mar 01

Merchant of record platform for digital products. Acquired by Stripe in October 2024. Being absorbed into 'Stripe Managed Payments' (announced May 2025, private preview). No official Python SDK exists — only community-maintained libraries. REST API uses JSON:API spec with Bearer auth.

Warnings

Install

Imports

Quickstart

Direct REST API usage. Response follows JSON:API spec — data is in response['data'], not response directly.

import requests
import os

API_KEY = os.getenv('LEMON_SQUEEZY_API_KEY')
BASE_URL = 'https://api.lemonsqueezy.com/v1'

headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Accept': 'application/vnd.api+json',
    'Content-Type': 'application/vnd.api+json'
}

# List products
resp = requests.get(f'{BASE_URL}/products', headers=headers)
products = resp.json()['data']
for product in products:
    print(product['id'], product['attributes']['name'])

# Verify webhook signature (HMAC-SHA256)
import hmac
import hashlib

def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
    expected = hmac.new(
        secret.encode(),
        payload,
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, signature)

view raw JSON →